package com.dayang.redbook.oss.biz.config;

import io.minio.MinioClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author: dayang
 * @since: 2024/7/1
 * @description: minio配置类
 */
@Configuration
public class MinioConfig {
    @Bean
    public MinioClient minioClient(MinioProperties minioProperties) {
        // 构建 Minio 客户端
        return MinioClient.builder()
                .endpoint(minioProperties.getEndpoint())
                .credentials(minioProperties.getAccessKey(), minioProperties.getAccessSecret())
                .build();
    }
}
